package day019.homework.p2;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        Collections.addAll(list, "cab", "bac", "acb", "cba", "bca", "abc");

//        Collections.sort(list);

//        Collections.sort(list, (a, b) -> b.compareTo(a));
//
        Collections.sort(list, (String s1, String s2) -> {
            return s2.compareTo(s1);
        });
//
//        Collections.sort(list, new Comparator<String>() {
//            @Override
//            public int compare(String s1, String s2) {
//                return s2.compareTo(s1);
//            }
//        });

        System.out.println(list);
    }
}
